package week01;

public class ticketmaker {
    private int ticket=1000;
    private static ticketmaker singleton = new ticketmaker();



    /**
     * Returns the runtime object associated with the current Java application.
     * Most of the methods of class <code>Runtime</code> are instance
     * methods and must be invoked with respect to the current runtime object.
     *
     * @return  the <code>Runtime</code> object associated with the current
     *          Java application.
     */
    public static ticketmaker getinstance() {
        return singleton;
    }

    /** Don't let anyone else instantiate this class */
    private ticketmaker() {}

    public synchronized int getNextTicketNumber(){
        return ticket++;
    }
}